<?php

namespace App\Http;

use App\Http\Middleware\AdminAuthenticate;
use App\Http\Middleware\ApiAuthenticate;
use App\Http\Middleware\VideoAdminAuthenticate;
use App\Http\Middleware\VideoApiAuthenticate;
use App\Http\Middleware\WebAuthenticate;
use App\Http\Middleware\WxapiAuthenticate;
use Illuminate\Foundation\Http\Kernel as HttpKernel;

class Kernel extends HttpKernel
{
    /**
     * The application's global HTTP middleware stack.
     *
     * These middleware are run during every request to your application.
     *
     * @var array
     */
    protected $middleware = [
        \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
    ];

    /**
     * The application's route middleware groups.
     *
     * @var array
     */
    protected $middlewareGroups = [
        'web' => [WebAuthenticate::class],
        'admin' => [
            AdminAuthenticate::class,
//            \Illuminate\Session\Middleware\StartSession::class,
        ],
        'api' => [
            'throttle:150,1',
            ApiAuthenticate::class
        ],
        'wxapi' => [
            'throttle:150,1',
            WxapiAuthenticate::class
        ],
        'saas' => [
            'throttle:200,1',
        ],
        'videoAdmin' => [
            'throttle:200,1',
            VideoAdminAuthenticate::class
        ],
        'videoApi' => [
            'throttle:200,1',
            VideoApiAuthenticate::class
        ],
    ];

    /**
     * The application's route middleware.
     *
     * These middleware may be assigned to groups or used individually.
     *
     * @var array
     */
    protected $routeMiddleware = [
        'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
        'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
        'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
        'can' => \Illuminate\Auth\Middleware\Authorize::class,
        'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
    ];
}
